{extend name="public/header" /}
{block name="body"}
<body>
{include file="public/common" /}
<!--头部搜索开始-->
<div class="layui-collapse" lay-accordion="">
	<div class="layui-colla-item">
		<h2 class="layui-colla-title">搜索</h2>
		<div class="layui-colla-content layui-show">
			<form class="layui-form" action="{:url('article/index')}">
				<div class="layui-form">
					<div class="layui-inline">
						<div class="layui-input-inline">
							<input class="layui-input" name="id" value="{$pageMaps.id|default=''}" placeholder="ID">
						</div>
					</div>
					<div class="layui-inline">
						<select name="nav_id">
							<option value="0">请选择栏目</option>
							{volist name='listlm' id='vo' key='k'}
							{if empty($vo['voo'])}
							<option value="{$vo.id}" {if condition="$vo.id eq $pageMaps.nav_id"}selected{/if}>{$vo.name}</option>
							{else/}
							<optgroup label="{$vo.name}">
								{volist name="vo['voo']" id='sub' key='t' empty="暂时没有数据"}
								{if empty($sub['voval'])}
								<option value="{$sub.id}" {if condition="$sub.id eq $pageMaps.nav_id"}selected{/if}>&nbsp;├&nbsp;{$sub.name}</option>
								{else/}
								<optgroup label="{$sub.name}">
									{volist name="sub['voval']" id='voval' key='t' empty="暂时没有数据"}
									<option value="{$voval.id}" {if condition="$voval.id eq $pageMaps.nav_id"}selected{/if}>&nbsp;&nbsp;&nbsp;&nbsp;├&nbsp;{$voval.name}</option>
									{/volist}
								</optgroup>
								{/if}
								{/volist}
							</optgroup>
							{/if}
							{/volist}
						</select>
					</div>
					<div class="layui-inline">
						<select name="ishot">
							<option value="">热门</option>
							<option value="1" {if condition="$pageMaps.ishot eq 1"} selected{/if}>正常</option>
							<option value="2" {if condition="$pageMaps.ishot eq 2"} selected{/if}>禁用</option>
						</select>
					</div>
					<div class="layui-inline">
						<select name="introduce">
							<option value="">推荐</option>
							<option value="1" {if condition="$pageMaps.introduce eq 1"} selected{/if}>正常</option>
							<option value="2" {if condition="$pageMaps.introduce eq 2"} selected{/if}>禁用</option>
						</select>
					</div>
					<div class="layui-inline">
						<select name="status">
							<option value="">状态</option>
							<option value="1" {if condition="$pageMaps.status eq 1"} selected{/if}>正常</option>
							<option value="2" {if condition="$pageMaps.status eq 2"} selected{/if}>禁用</option>
						</select>
					</div>
					
					<div class="layui-inline">
						<button lay-submit class="layui-btn" lay-filter="search"><i class="layui-icon">&#xe615;</i>查找</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<!--头部搜索结束-->
<div class="layui-form">
    <table class="layui-table" lay-size="sm">
        <thead>
        <tr>
            <th width="80">ID</th>
			<th>标题</th>
			<th>所属栏目</th>
			<th>浏览量</th>
			<th>发布时间</th>
			<th>热门</th>
			<th>推荐</th>
			<th>状态</th>
            <th width="200">操作</th>
        </tr>
        </thead>
        <tbody>
		{if(count($list)<1)}
            <tr>
                <td colspan="9" align="center">暂无相关数据</td>
            </tr>
            {else /}
			{volist name='list' id='vo' key='k'}
			<tr>
				<td>{$vo.id}</td>
				<td>{$vo.title}</td>
				<td>{$vo.nav_name}</td>
				<td>{$vo.view}</td>
				<td>{:rttime($vo['addtime'])}</td>
				<td><input type="checkbox" lay-skin="switch" lay-filter="switch" value="{$vo.ishot}" lay-text="正常|禁用" {if $vo.ishot==1}checked{/if} data-url='{:url("ajax/upField",array("table"=>"article","id_name"=>"id","id_value"=>$vo["id"],"field"=>"ishot"))}'></td>
				<td><input type="checkbox" lay-skin="switch" lay-filter="switch" value="{$vo.introduce}" lay-text="正常|禁用" {if $vo.introduce==1}checked{/if} data-url='{:url("ajax/upField",array("table"=>"article","id_name"=>"id","id_value"=>$vo["id"],"field"=>"introduce"))}'></td>
				<td><input type="checkbox" lay-skin="switch" lay-filter="switch" value="{$vo.status}" lay-text="正常|禁用" {if $vo.status==1}checked{/if} data-url='{:url("ajax/upField",array("table"=>"article","id_name"=>"id","id_value"=>$vo["id"],"field"=>"status"))}'></td>
				<td>
					<a class="layui-btn layui-btn-xs modal-catch" href="{:url('article/info',array('id'=>$vo['id']))}">
						<i class="layui-icon">&#xe642;</i>编辑
					</a>
					<a class="layui-btn layui-btn-xs layui-btn-danger ajax-del" data-url='{:url("article/del")}' data-field='id' data-value='{$vo.id}'>
						<i class="layui-icon">&#xe640;</i>删除
					</a>
				</td>
			</tr>
			{/volist}
		{/if}
        </tbody>
    </table>
</div>
<div class="text-right">
    <div class="layui-box layui-laypage layui-laypage-molv" id="layui-laypage">
        {$_page|raw}
    </div>
</div>
</body>
{/block}
{block name="script"}
<script>
layui.use(['jquery','laydate','form','layajax','layer'], function(){
	var $ = layui.jquery
		,form = layui.form
		,laydate = layui.laydate
		,layer = layui.layer
		,layajax = layui.layajax;

	form.render();
});
</script>
{/block}